***Study 2-Analysis**************

*correlation between partisanship and racial resentment

pwcorr pid7 symrace

*             |     pid7  symrace
*-------------+------------------
*        pid7 |   1.0000 
*     symrace |   0.3838   1.0000 

. mean symrace if pid7<.5

***************************************
***Frequency Distributions**************************

**Appendix Figure B1
histogram parents,  frequency  color(eltblue) lcolor(none) title("Distribution of Support for Parental Responsibility over Topic Selection") xtitle("parents") ytitle("Frequency") graphregion(color(white)) scheme(s1color)
	
*Appendix Figure B2
histogram symrace,  frequency  color(eltblue) lcolor(none) title("Distribution of Racial Resentment") xtitle("Racial Resentment") ytitle("Frequency") graphregion(color(white)) scheme(s1color)	

*Appendix Figure B3
histogram pid7,  frequency  color(eltblue) lcolor(none) title("Figure B3. Distribution of Partisanship") xtitle("Partisanship") ytitle("Frequency") graphregion(color(white)) scheme(s1color)	

****TABLE 2 and appendix table B1**************************************************************************************

eststo: reg parents i.educationt, r
test _b[1.educationt]=_b[2.educationt]
*( 1)  1.educationt - 2.educationt = 0
* F(  1,   918) =    0.91
* Prob > F =    0.3415
***The two history treatments are not statistically different from each other.
eststo: reg parents i.educationt symrace pid7 ideology age3044 age4564 age65p female child  income college i.Q80 , r
eststo: reg parents i.educationt##c.symrace pid7 ideology age3044 age4564 age65p female child income college i.Q80, r
eststo: reg parents i.educationt##c.pid7 c.symrace ideology age3044 age4564 age65p female child income college i.Q80 , r
test c.pid7 1.educationt#c.pid7 2.education#c.pid7
*Pid is not significant in the main effects model, so specify test of joint significance. This is null.
*( 1)  pid7 = 0
*( 2)  1.educationt#c.pid7 = 0
*( 3)  2.educationt#c.pid7 = 0
* F(  3,   871) =    0.68
*Prob > F =    0.5668
eststo: reg parents i.educationt##c.symrace i.educationt##c.pid7 ideology age3044 age4564 age65p female child income college i.Q80 , r
test c.pid7 1.educationt#c.pid7 2.education#c.pid7
*TTest of joint significance for pid remains null.
 *( 1)  pid7 = 0
 *( 2)  1.educationt#c.pid7 = 0
 *( 3)  2.educationt#c.pid7 = 0

  *     F(  3,   869) =    1.63
   *         Prob > F =    0.1813
estout using "C:\Users\Alexandra Filindra\Dropbox\My Research Projects\Currently active\3. Education-control of decisions\education-curriculum\stata_results.txt", style(fixed) stats(N r2_a F p, fmt(4 3)) cells("b(star fmt(3))" se(par(`"="("'`")""')fmt(2))) starlevels(* 0.10 ** 0.05 *** 0.01) replace

eststo clear

**********************************************************************************************************************
***FIGURE 5. Main effects

eststo: reg parents i.educationt, r
margins educationt
marginsplot, recast(scatter) recastci(rcap) plotopts(msymbol(O) msize(medium) color(navy)) ciopts(lcolor(navy)) name(pred_plot, replace)ytitle("Support for Parents Being Responsible")  xtitle("Treatment Group") title("Predicted Margins and Group Means") legend(order(1 "Predicted Margin" 2 "95% CI"))

***************************************************************************************************************************
***FIGURE 6: Combined Interaction Effects 

reg parents i.educationt##c.symrace i.educationt##c.pid7 ideology age3044 age4564 age65p female child income college i.Q80, r
* First interaction plot: Treatment × Racial Resentment
margins educationt, at(symrace=(0(.5)1))
marginsplot, xdimension(symrace) recast(line) recastci(rarea) ciopts(color(%20)) ytitle("Predicted Support for Parents Being Responsible") xtitle("Racial Resentment") title("Interaction: Treatment × Racial Resentment") legend(pos(6)) name(gr1, replace)

* Second interaction plot: Treatment × Partisanship
margins educationt, at(pid7=(0(.5)1))
marginsplot, xdimension(pid7) recast(line) recastci(rarea) ciopts(color(%20)) ytitle("Predicted Support for Parents Being Responsible")xtitle("Partisanship") title("Interaction: Treatment × Partisanship") legend(pos(6)) name(gr2, replace)

* Combine the two graphs side by side
graph combine gr1 gr2, col(2)

*****************************************************************************************************************************

**Appendix Table B2** Additional Interactions

eststo clear
eststo: reg parents i.educationt##i.female symrace pid7 ideology age3044 age4564 age65p child  income college i.Q80 , r
eststo: reg parents i.educationt##i.child symrace pid7 ideology age3044 age4564 age65p female  income college i.Q80 , r	
eststo: reg parents i.educationt##i.evangelical symrace pid7 ideology age3044 age4564 age65p female child  income college , r  
estout using "C:\Users\aAlexandra Filindra\Dropbox\My Research Projects\Currently active\3. Education-control of decisions\education-curriculum\stata_results.txt", style(fixed) stats(N r2_a F p, fmt(4 3)) cells("b(star fmt(3))" se(par(`"="("'`")""')fmt(2))) starlevels(* 0.10 ** 0.05 *** 0.01) replace
eststo clear

************************************************************************************************
*Table B3: THree-way Interaction & Interaction Plot

eststo: reg parents i.educationt##c.pid7##c.symrace ideology age3044 age4564 age65p female child income college i.Q80 , r
test c.pid7 1.educationt#c.pid7 2.educationt#c.pid7 c.symrace#c.pid7 1.educationt#c.pid7#c.symrace 2.educationt#c.pid7#c.symrace
margins educationt, at(pid7=(0 .5 1) symrace=(0 .5 1))

marginsplot, xdimension(symrace) by(pid7, note("") subtitle("Partisanship"))  recast(line) recastci(rarea) ciopts(color(%20))  ytitle("Predicted Support for Parents Being Responsible") xtitle("Racial Resentment") title("3-Way Interaction: Treatment × Partisanship × Racial Resentment")  legend(off)
 
estout using "C:\Users\aAlexandra Filindra\Dropbox\My Research Projects\Currently active\3. Education-control of decisions\education-curriculum\stata_results.txt", style(fixed) stats(N r2_a F p, fmt(4 3)) cells("b(star fmt(3))" se(par(`"="("'`")""')fmt(2))) starlevels(* 0.10 ** 0.05 *** 0.01) replace
eststo clear

 
sum parents i.educationt symrace identity xenophobia pid7 ideology age3044 age4564 age65p female income college 



**************************************************
**OLOGIT MODELS


eststo: ologit parents i.educationt , r
test _b[1.educationt]=_b[2.educationt]
eststo: ologit parents i.educationt symrace pid7 ideology age3044 age4564 age65p female child  income college i.Q80 , r
eststo: ologit parents i.educationt##c.symrace pid7 ideology age3044 age4564 age65p female child income college i.Q80 , r
eststo: ologit parents i.educationt##c.pid7 c.symrace ideology age3044 age4564 age65p female child income college i.Q80 , r
test c.pid7 1.educationt#c.pid7 2.education#c.pid7
eststo: ologit parents i.educationt##c.symrace i.educationt##c.pid7 ideology age3044 age4564 age65p female child income college i.Q80, r
test c.pid7 1.educationt#c.pid7 2.education#c.pid7
eststo: ologit parents i.educationt##c.pid7##c.symrace ideology age3044 age4564 age65p female child income college i.Q80 , r
test c.pid7 1.educationt#c.pid7 2.educationt#c.pid7 c.symrace#c.pid7 1.educationt#c.pid7#c.symrace 2.educationt#c.pid7#c.symrace	  
eststo: ologit parents i.educationt##i.female symrace pid7 ideology age3044 age4564 age65p child  income college i.Q80 , r
eststo: ologit parents i.educationt##i.child symrace pid7 ideology age3044 age4564 age65p female  income college i.Q80 , r	
eststo: ologit parents i.educationt##i.evangelical symrace pid7 ideology age3044 age4564 age65p female child  income college , r  
	  
estout using "C:\Users\alekaAlexandra Filindra\Dropbox\My Research Projects\Currently active\3. Education-control of decisions\education-curriculum\stata_results.txt", style(fixed) stats(N r2_a F p, fmt(4 3)) cells("b(star fmt(3))" se(par(`"="("'`")""')fmt(2))) starlevels(* 0.10 ** 0.05 *** 0.01) replace

eststo clear


****************************
*BALANCE TESTS*
**Balance across treatments
mean symrace if educationt==0
mean symrace if educationt==1
mean symrace if educationt==2
reg educationt symrace if white==1
mean pid7 if educationt==0
mean pid7 if educationt==1
mean pid7 if educationt==2
reg educationt pid7 if white==1
mean ideology if educationt==0
mean ideology if educationt==1
mean ideology if educationt==2
reg educationt ideology if white==1
mean female if educationt==0
mean female if educationt==1
mean female if educationt==2
reg educationt female if white==1
mean income if educationt==0
mean income if educationt==1
mean income if educationt==2
reg educationt income if white==1
mean college if educationt==0
mean college if educationt==1
mean college if educationt==2
reg educationt college if white==1
mean evangelical if educationt==0
mean evangelical if educationt==1
mean evangelical if educationt==2
reg educationt evangelical if white==1
mean age1829 if educationt==0
mean age1829 if educationt==1
mean age1829 if educationt==2
reg educationt age1829 if white==1
mean age3044 if educationt==0
mean age3044 if educationt==1
mean age3044 if educationt==2
reg educationt age3044 if white==1
mean age4564 if educationt==0
mean age4564 if educationt==1
mean age4564 if educationt==2
reg educationt age4564 if white==1
mean age65p if educationt==0
mean age65p if educationt==1
mean age65p if educationt==2
reg educationt age65p if white==1

**treatment effect on symrace is null

reg symrace i.educationt if white==1, r
reg symrace i.educationt if white==0, r